using BepuPhysics.Collidables;
#if MYCODE
using BepuUtilities.Vectors;
#else
using System.Numerics;
#endif

namespace BepuPhysics
{
    /// <summary>
    /// 描述静电对象的属性。添加到模拟中时,静电对象可以碰撞,但没有速度,并且不会对力做出响应而移动。
    /// </summary>
    public struct StaticDescription
    {
        /// <summary>
        /// --静电的定位和定位。
        /// </summary>
        public RigidPose Pose;
        /// <summary>
        /// 静电的可碰撞特性。
        /// </summary>
        public CollidableDescription Collidable;

        /// <summary>
        /// 构建新的静电描述。
        /// </summary>
        /// <param name="Position">静电的位置。</param>
        /// <param name="Orientation">静电的方向。</param>
        /// <param name="可碰撞">静电的可碰撞描述。</param>
        public StaticDescription(in Vector3 position, in Quaternion orientation, in CollidableDescription collidable)
        {
            Pose.Position = position;
            Pose.Orientation = orientation;
            Collidable = collidable;
        }

        /// <summary>
        /// 构建新的静电描述。
        /// </summary>
        /// <param name="Position">静电的位置。</param>
        /// <param name="可碰撞">静电的可碰撞描述。</param>
        public StaticDescription(in Vector3 position, in CollidableDescription collidable) : this(position, Quaternion.Identity, collidable)
        {
        }

        /// <summary>
        /// 构建具有离散连续性的新静电描述。
        /// </summary>
        /// <param name="Position">静电的位置。</param>
        /// <param name="Orientation">静电的方向。</param>
        /// <param name="shapeIndex">模拟形状集中静电形状的索引。</param>
        /// <param name="speculativeMargin">静电表面之外的距离,以允许生成投机性联系人。</param>
        public StaticDescription(in Vector3 position, in Quaternion orientation, TypedIndex shapeIndex, float speculativeMargin)
        {
            Pose.Position = position;
            Pose.Orientation = orientation;
            Collidable.Continuity = new ContinuousDetectionSettings();
            Collidable.Shape = shapeIndex;
            Collidable.SpeculativeMargin = speculativeMargin;
        }

        /// <summary>
        /// 构建具有离散连续性的新静电描述。
        /// </summary>
        /// <param name="Position">静电的位置。</param>
        /// <param name="shapeIndex">模拟形状集中静电形状的索引。</param>
        /// <param name="speculativeMargin">超出正文表面的距离,以允许生成推测性联系人。</param>
        public StaticDescription(in Vector3 position, TypedIndex shapeIndex, float speculativeMargin) : this(position, Quaternion.Identity, shapeIndex, speculativeMargin)
        {
        }
    }

}
